package bean;

import javax.swing.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * 运动员基本信息类
 */
public class Athlete implements Serializable {
    private static final long serialVersionUID = 1L;
    private String a_id;  //运动员id
    private String name;  //运动员姓名
    private String sex;   //性别
    private int age;      //年龄
    private String department; //专业名称
    private String c_id;       //参加的运动比赛id
    //当前登录的运动员信息
    public static String myA_id;
    public static String myName;
    public static int myAge;
    public static String mySex;
    public static String myDepartment;
    public static String myC_id;
    public Athlete() {
    }

    @Override
    public String toString() {
        return "Athlete{" +
                "a_id='" + a_id + '\'' +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", department='" + department + '\'' +
                ", c_id='" + c_id + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Athlete athlete = (Athlete) o;
        return age == athlete.age && Objects.equals(a_id, athlete.a_id) && Objects.equals(name, athlete.name) && Objects.equals(sex, athlete.sex) && Objects.equals(department, athlete.department) && Objects.equals(c_id, athlete.c_id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(a_id, name, sex, age, department, c_id);
    }

    public String getA_id() {
        return a_id;
    }

    public void setA_id(String a_id) {
        this.a_id = a_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getC_id() {
        return c_id;
    }

    public void setC_id(String c_id) {
        this.c_id = c_id;
    }

    public Athlete(String a_id, String name, String sex, int age, String department, String c_id) {
        this.a_id = a_id;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.department = department;
        this.c_id = c_id;
    }
}
